﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Diagnostics;

namespace RMS.Utils.DatabaseSchema
{
    public class Column
    {
        #region [Properties]

        public string Name { get; set; }
        public int DataTypeLenght { get; set; }
        public SqlDbType DatabaseType { get; set; }
        public bool IsPrimaryKey { get; set; }
        public bool IsForeignKey { get; set; }
        public bool IsIdentity { get; set; }
        public bool IsNullable { get; set; }
        public string DefaultValue { get; set; }
        public Type MappedDotNetType
        {
            get
            {
                return ConvertHelper.DbTypeToType(this.DatabaseType);
            }
        }
        public string RelatedToPrimaryKeyInTable { get; set; }
        public List<string> RelatedToForeignKeyInTable { get; set; }

        #endregion
        public Column()
        {
            RelatedToForeignKeyInTable = new List<string>();
        }

    }
}